Ext.define('AiW.' + _pacote + '.view.WinAtenderTelefone', {
    extend: 'AiW.view.ya.lib.YaWindow',

    requires: [
        'Ext.form.FieldSet',
        'Ext.form.field.Text',
        'Ext.button.Button',
        'Ext.grid.Panel',
        'Ext.grid.column.Number',
        'Ext.grid.column.Date',
        'Ext.grid.column.Boolean',
        'Ext.grid.View'
    ],

    itemId: 'winAtenderTelefone',
    height: 250,
    width: 400,
    title: 'Anotar Pedido',
    iconCls: 'anotarPedido',

    anchor: '100%',
    items: [
        {
            xtype: 'fieldset',
            title: 'Buscar Cliente',
            height: 50,

            items: [
                {
                    xtype: 'container',
                    layout: 'column',
                    items: [
                        {
                            xtype: 'numberfield',
                            fieldLabel: 'Telefone',
                            blankText: 'Informe o telefone',
                            allowBlank: false,
                            selectOnFocus: true,
                            enableKeyEvents: true,
                            // Remove spinner buttons, and arrow key and mouse wheel listeners
                            hideTrigger: true,
                            keyNavEnabled: false,
                            mouseWheelEnabled: false,
    
                            listeners: {
                                keyup: function(a, b) {
                                    //Executa a chamada do submit
                                    this.up('#winAtenderTelefone').teclaEnter(a, b);
                                }
                            }
                        },
                        {
                            xtype: 'button',
                            text: 'Pesquisar',
                            iconCls: 'pesquisar',
                            handler: function() {
                                this.up('#winAtenderTelefone').buscar();
                            }
                        }
                    ]
                }
            ]
        },
        {
            xtype: 'panel',
            anchor: '100%',
            items: {
                xtype: 'gridpanel',
                title: 'My Grid Panel',
                anchor: '100%',
                columns: [
                    {
                        xtype: 'gridcolumn',
                        dataIndex: 'string',
                        text: 'String'
                    },
                    {
                        xtype: 'numbercolumn',
                        dataIndex: 'number',
                        text: 'Number'
                    },
                    {
                        xtype: 'datecolumn',
                        dataIndex: 'date',
                        text: 'Date'
                    },
                    {
                        xtype: 'booleancolumn',
                        dataIndex: 'bool',
                        text: 'Boolean'
                    }
                ]
            }
        }
    ],

    listeners: {
        close: function() {
            Ext.getCmp('btnAtender').setDisabled(false);
        }
    },

    teclaEnter: function (a, b) {
        if (b.getKey() === b.ENTER) {
            b.stopEvent();
            this.buscar();
        }
    },

    buscar: function () {
        console.log('passou aqui aa');
        this.el.mask('Pesquisando...');
    }

});